package tests;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

public class TestUtil {

	
	public static String readFile(String filePath){
		FileInputStream filStr;
		StringBuilder sb = new StringBuilder();
		try {
			filStr = new FileInputStream(new File(filePath));
			BufferedReader br = new BufferedReader(new InputStreamReader(filStr));
			String currentLine;
			while((currentLine = br.readLine()) != null){
				sb.append(currentLine+ "\n");
			}
			br.close();
		} catch (FileNotFoundException e) {
			System.err.println("File not found");
		} catch (IOException e) {
			System.err.println("Cannot read from file");
		}
		return sb.toString();
		
	}
	
}
